local item_list = {}
local hero_skill_data = {}
for i,v in ipairs(load_excel('技能数据.xlsx','英雄技能')) do
    local k = v.name
    v.name = k
    v.art = v.art or [[ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp]]
    v.skill_type = '英雄技能'
    v.data1 = v.data1 or 0
    v.data2 = v.data2 or 0
    v.data3 = v.data3 or 0
    v.permanent = false

    local dmg_tip = get_dmgty_tip(v)
    v.tip = ('%s|n|n%s'):format(v.tip,v['公式说明'] or '')
    if dmg_tip then
        v.tip = ('%s|n|n%s'):format(dmg_tip,v.tip)
    end
    if v.passive then
        v.skill_type = 'passive'
    end
    v.skill_type = 'passive'

    ac.lni('skill',k,v)

    
    local temp = ac.dummy_unit:add_skill(k,'英雄')
    temp:remove()
    hero_skill_data[k] = temp
    table.insert(item_list,temp)
end


function get_hero_skill_data(name)
    return hero_skill_data[name]
end

--测试数据注册
ac.wait(1000,function()
    local test_data = table.copy(item_list)
    ac.game:notify('测试-注册数据','英雄技能',test_data,function(_,player,name)
        local hero = player.hero
        if hero then
            hero:add_skill(name,'英雄')
        end
    end)
end)
